<!doctype html>
<title>Using splice</title>

<script>

//Create an empty array
var closet = ["hat", "umbrella", "katana"];

//splice out the middle element
var middleElement = closet.splice(1, 1);

//View the value of middleElement
console.log("The spliced element: " + middleElement);

//View the new closet array
console.log("The closet array: " + closet);

</script>